package com.agh.szepczynski.magisterka.service.security;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.agh.szepczynski.magisterka.service.conf.SpringAppConfiguration;
import com.agh.szepczynski.magisterka.service.conf.SpringContainer;

public class MyResourceConfig extends ResourceConfig {
	protected static final Log logger = LogFactory
			.getLog(MyResourceConfig.class);
	public MyResourceConfig() {
		logger.debug("uruchamiam sie");
		register(ResponseCorsFilter.class);

		ApplicationContext context = new AnnotationConfigApplicationContext(
				SpringAppConfiguration.class);
		SpringContainer.setInstance(new SpringContainer(context));

	}
}
